/* 模态框遮罩层 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 模态框主体 */
.modal {
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* 头部 */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.clearAllBtn {
  font-size: 14px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.clearAllBtn:hover {
  background-color: #f5f5f5;
  color: #666;
}

/* 内容区域 */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  max-height: calc(70vh - 120px);
}

/* 项目列表 */
.item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: white;
  transition: background-color 0.3s;
}

.item:hover {
  background-color: #fafafa;
}

.item:last-child {
  border-bottom: none;
}

/* 项目图标 */
.itemIcon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.iconText {
  font-size: 16px;
  color: white;
}

/* 项目信息 */
.itemInfo {
  flex: 1;
  min-width: 0;
  margin-right: 12px;
}

.itemName {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}

.itemPrice {
  font-size: 13px;
  color: #ff4d4f;
  font-weight: 600;
  margin-bottom: 4px;
}

.itemTags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  line-height: 1.2;
}

.prescriptionTag {
  background: #e6f7ff;
  color: #1890ff;
  border: 1px solid #91d5ff;
}

.limitTag {
  background: #fff2e8;
  color: #fa8c16;
  border: 1px solid #ffd591;
}

/* 项目操作 */
.itemActions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* 数量选择器 */
.quantitySelector {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;
}

.quantityBtn {
  width: 28px;
  height: 28px;
  border: none;
  background: #e8e8e8;
  color: #666;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.quantityBtn:hover:not(:disabled) {
  background: #d9d9d9;
  color: #333;
}

.quantityBtn:disabled {
  background: #f0f0f0;
  color: #ccc;
  cursor: not-allowed;
}

.quantityValue {
  min-width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background: white;
  border-left: 1px solid #e8e8e8;
  border-right: 1px solid #e8e8e8;
}

/* 复选框 */
.checkboxContainer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid #1890ff;
  border-radius: 50%;
  background: #1890ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.checkmark {
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* 空状态 */
.emptyState {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.emptyIcon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.emptyText {
  font-size: 16px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.emptySubText {
  font-size: 14px;
  color: #999;
}

/* 底部汇总栏 */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #f0f0f0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.summary {
  display: flex;
  align-items: center;
  flex: 1;
}

.summaryIcon {
  font-size: 20px;
  margin-right: 8px;
  color: #1890ff;
}

.summaryText {
  display: flex;
  flex-direction: column;
}

.summaryCount {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  margin-bottom: 2px;
}

.summaryTotal {
  font-size: 16px;
  color: #ff4d4f;
  font-weight: 600;
}

.submitBtn {
  background: #1890ff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  min-width: 80px;
}

.submitBtn:hover {
  background: #40a9ff;
}

.submitBtn:active {
  background: #096dd9;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .modal {
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
  }
  
  .header {
    padding: 20px;
  }
  
  .title {
    font-size: 18px;
  }
  
  .item {
    padding: 20px;
  }
  
  .itemName {
    font-size: 15px;
  }
  
  .itemPrice {
    font-size: 14px;
  }
  
  .quantityBtn {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  
  .quantityValue {
    min-width: 36px;
    height: 32px;
    font-size: 15px;
  }
  
  .footer {
    padding: 20px;
  }
  
  .summaryCount {
    font-size: 15px;
  }
  
  .summaryTotal {
    font-size: 18px;
  }
  
  .submitBtn {
    padding: 14px 28px;
    font-size: 16px;
    min-width: 90px;
  }
}

/* 滚动条样式 */
.content::-webkit-scrollbar {
  width: 4px;
}

.content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}

.content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
